#!/usr/bin/pythonBasics
# -*- coding: utf-8 -*-
# @Time : 2021/4/14 11:06
# @Author : super
# @File : t_school
# @Project : pythonFile

from mySqlProject.ch03.base.Dao import pool

class SchoolDao():

	#查询学生表
	def selectStudent(self):
		try:
			con = pool.get_connection()
			cursor = con.cursor()
			cursor.execute('SELECT * FROM student;')
			return cursor.fetchall()
		except Exception as e:
			if 'con' in dir():
				con.close()
			print(e)
		finally:
			if 'con' in dir():
				con.close()

if __name__ == '__main__':
    o = SchoolDao()
    print(o.selectStudent())